package com.zy.design.state;

/**
 * @author hugx
 * @create 2018-09-13 10:08
 */
public class CloseDoorState implements  LiftState {
    private StateContext context;


    @Override
    public void setStateConetxt(StateContext context) {
        this.context=context;
    }


    @Override
    public void openDoor() {
         context.setLiftState(context.openDoorState);
         context.getLiftState().openDoor();
    }

    /**
     * 在关闭close状态下，电梯可以执行open,runing 操作
     */
    @Override
    public void closeDoor() {
        System.out.println("关闭电梯门");
    }

    @Override
    public void runing() {
       context.setLiftState(context.runingDoorState);
       context.getLiftState().runing();
    }

    @Override
    public void stop() {

    }
}
